package com.xiaochong.tir.api.component.actor;

import akka.actor.UntypedActor;
import com.xc.logclient.utils.LogTrace;
import com.xiaochong.tir.api.service.CurrencyDiagnosisService;
import com.xiaochong.tir.api.service.TokenIndexRankService;
import com.xiaochong.tir.api.util.SpringContextUtil;

/**
 * Created by org on 2018/5/12.
 * 通证指数大盘分析5分钟跑一次
 */
public class AkkaTokenIndexRankMoneyPopFive extends UntypedActor{
    /**
     * 大盘分析赚钱、权重、量能
     */
    private TokenIndexRankService tokenIndexRankService =
            (TokenIndexRankService) SpringContextUtil.getBean("tokenIndexRankService");


    @Override
    public void onReceive(Object o) throws Exception {
        LogTrace.beginTrace("大盘分析赚钱、权重、量能");
        Long start = System.currentTimeMillis();
        //赚钱
        tokenIndexRankService.MarkMoneyEffectToCache();
        //量能
        tokenIndexRankService.MarketInterpretationChangeToCache();
        //权重
        tokenIndexRankService.MarketWeightsPerformanceToCache();
        LogTrace.info("Akka大盘分析赚钱、权重、量能5分钟存入redis","Akka大盘分析赚钱耗时",String.valueOf(System.currentTimeMillis()-start));
    }
}
